package com.itheima.ood.inner.demo05;

public class JumpDemo {

    public static void main(String[] args) {

        new Jump(){


            @Override
            public void jump() {
                System.out.println("jump......");
            }
        }.jump();

        new Animal() {


            @Override
            public void eat() {
                System.out.println("eat...1...");
            }

            @Override
            public void drink() {
                System.out.println("drink...1...");
            }
        };

        new Animal(){
            @Override
            public void eat() {
                System.out.println("eat...2...");
            }

            @Override
            public void drink() {
                System.out.println("drink...2...");
            }
        }.eat();

        new Animal(){
            @Override
            public void eat() {
                System.out.println("eat...2...");
            }

            @Override
            public void drink() {
                System.out.println("drink...2...");
            }
        }.drink();

        Animal animal = new Animal() {
            @Override
            public void eat() {
                System.out.println("eat...3...");
            }

            @Override
            public void drink() {
                System.out.println("drink...3...");
            }
        };

        animal.eat();
        animal.drink();

    }
}
